//#define  _CRT_SECURE_NO_WARNINGS
//long long minimumPerimeter(long long neededApples)
//{
//    long long int  n = 1;
//    for (n = 1; 2 * n * (n + 1) * (2 * n + 1) < neededApples; n++);
//    return 8 * n;
//}